<?php if ($deals): ?>

<?php echo form_open('admin/blog/action'); ?>

<table border="0" class="table-list coupon-table">
    <thead>
    <tr>
        <th width="20" class="align-center"><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all')); ?></th>
        <th width="150" class="align-center"><?php echo lang('groupon_time_label'); ?></th>
        <th><?php echo lang('groupon_sales_label'); ?></th>
        <th width="100" class="align-center"><?php echo lang('groupon_price_label'); ?></th>
        <th width="150" class="align-center">
            <span><?php echo lang('actions_label'); ?></span>
        </th>
    </tr>
    </thead>
    <tfoot>
    <tr>
        <td colspan="7">
            <div class="inner">
                <?php $this->load->view('admin/partials/pagination'); ?>
            </div>
        </td>
    </tr>
    </tfoot>
    <tbody>
        <?php foreach ($deals as $deal): ?>
    <tr>
        <td><?php echo form_checkbox('action_to[]', $deal->id); ?></td>
        <td>
            <div class="groupon_start_time" title="<?php echo lang('groupon_start_tips');?>">
                <span style="color: #FF0000"><u>S:</u>&nbsp;</span><span><?php echo format_date($deal->start_date, 'd/m/Y'); ?>
                - <?php echo format_date($deal->start_date, 'H:i'); ?></span>
            </div>
            <div class="groupon_start_time" title="<?php echo lang('groupon_end_tips');?>">
                <span style="color: #FF0000"><u>E:</u>&nbsp;</span><span><?php echo format_date($deal->end_date, 'd/m/Y'); ?>
                - <?php echo format_date($deal->end_date, 'H:i'); ?></span>
            </div>
        </td>
        <td><span style="font-size: 10px"><?php echo $deal->title; ?></span></td>
        <td class="align-right">
            <?php echo format_price($deal->discounted_price); ?>
            <br/>
            <s><?php echo format_price($deal->original_price); ?></s>
            <br/>
            <?php echo lang('groupon_discount') . ' ' . $deal->discount_percentage . '%';?>
        </td>
        <td class="align-center buttons buttons-small">
            <?php echo anchor('admin/groupon/edit/' . $deal->id, lang('edit_label'), 'class="edit"'); ?>
            <br/>
            <?php echo anchor('admin/groupon/delete/' . $deal->id, lang('delete_label'), 'class="confirm delete"'); ?>
            <br/>
            <?php echo anchor('admin/groupon/copy/' . $deal->id, lang('copy_label'), array('class' => 'copy')); ?>
        </td>
    </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<div class="buttons align-right padding-top">
    <?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete', 'publish'))); ?>
</div>

<?php echo form_close(); ?>

<?php else: ?>
<div class="blank-slate">
    <h2><?php echo lang('groupon_currently_no_posts'); ?></h2>
</div>
<?php endif; ?>